package game.tileMap.model.vo
{
	import flash.events.EventDispatcher;
	import flash.geom.Point;
	
	import game.tileMap.model.Battler;
	import game.tileMap.model.vo.Character;
	

	public class BossUnit extends Battler
	{
		
		public function BossUnit()
		{
			
			
		}
		
		override public function onPos(x:int, y:int):Boolean{
			if (this.x == x && this.y == y) return true;
			if (this.x+1 == x && this.y == y) return true;
			if (this.x == x && this.y+1 == y) return true;
			if (this.x+1 == x && this.y+1 == y) return true;
			return false
		}
		
		
		override public function passable(X:int, Y:int):Boolean{
			var old:Boolean=through
			through=true;
			var pass:Boolean=true;
			if (!map.passable(X,Y))pass=false
			if (!map.passable(X+1,Y))pass=false
			if (!map.passable(X,Y+1))pass=false
			if (!map.passable(X+1,Y+1))pass=false
				through=old;
			return pass;
		}
		
	
		
		/**
		 *攻击范围 
		 * @return 
		 * 
		 */		
		 override public function get atkR():int{
			
			return 1;
		}
		 
		 override public function moveTo(x:int,y:int):void{
			 if (!passable(x,y))return ;
			 if (!passable(x+1,y))return ;
			 if (!passable(x,y+1))return ;
			 if (!passable(x+1,y+1))return ;
			 
			 this.x=x;
			 this.y=y;
		 }
	}
}